﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Database;

namespace Communication
{
    [ServiceContract(CallbackContract = typeof(IClientCommunication), SessionMode = SessionMode.Required)]
    public interface IServerCommunication
    {
        [OperationContract]
        bool Subscribe();

        [OperationContract(IsOneWay = true)]
        void Login(string flag, string user, Byte[] password, int forumId);

        [OperationContract(IsOneWay = true, IsTerminating = true)]
        void Logout(User me, int forumId);
        
        [OperationContract(IsOneWay = true)]
        void Register(string name, string last, string nick, string pass, string email, int forumId);


        #region Get/Add/Edit/Remove Forum/SubForum/Thread/Post

        [OperationContract(IsOneWay = true)]
        void GetForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void GetForum2(int forum);

       // [OperationContract(IsOneWay = true)]
        //void AddForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void EditForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void DeleteForum(ClientRequest req);


        [OperationContract(IsOneWay = true)]
        void GetSubForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void AddSubForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void EditSubForum(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void DeleteSubForum(ClientRequest req);


        [OperationContract(IsOneWay = true)]
        void GetThread(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void AddThread(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void EditThread(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void DeleteThread(ClientRequest req);


        [OperationContract(IsOneWay = true)]
        void GetPost(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void AddPost(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void EditPost(ClientRequest req);

        [OperationContract(IsOneWay = true)]
        void DeletePost(ClientRequest req);

        #endregion


        [OperationContract(IsOneWay = true)]
        void AddModerator(User me, string name, string forum, int forumId);

        [OperationContract(IsOneWay = true)]
        void DeleteModerator(User me, string name, string forum, int forumId);
        
        [OperationContract(IsOneWay = true)]
        void ExchangeModerator(User me, string oldMod, string newMod, string forum, int forumId);

        [OperationContract(IsOneWay = true)]
        void AddForum(User me, User manager, string forum, int policy, List<string> badWords);

        [OperationContract(IsOneWay = true)]
        void DeleteManager(User me, string name, string forum);

        [OperationContract(IsOneWay = true)]
        void GetForumStatistics(User me, int forumID);
        [OperationContract(IsOneWay = true)]
        void GetSystemStatistics(string admin, string adminPassword);


        [OperationContract(IsOneWay = true)]
        void getSystemUserList();
        [OperationContract(IsOneWay = true)]
        void getForumUserList(User user, int forumID);

        [OperationContract(IsOneWay = true)]
        void AdminExit(User user);

        [OperationContract(IsOneWay = true)]
        void ConfirmMailForRegister(string name, string last, string nick, string pass, string email, int forumid, string code);
    }
}
